home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / pibt40s1.arc / GETCOMAN.MOD < prev    next >
Text File  |  1987-08-12  |  4KB  |  83 lines

  1. (*----------------------------------------------------------------------*)
  2. (*      Get_Command_Line_Parameters --- Get command line parameters     *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Get_Command_Line_Parameters;
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*     Procedure:  Get_Command_Line_Parameters                          *)
  10. (*                                                                      *)
  11. (*     Purpose:    Gets command line parameters for PibTerm             *)
  12. (*                                                                      *)
  13. (*     Calling Sequence:                                                *)
  14. (*                                                                      *)
  15. (*        Get_Command_Line_Parameters;                                  *)
  16. (*                                                                      *)
  17. (*----------------------------------------------------------------------*)
  18.  
  19. VAR
  20.    S : AnyStr;
  21.    S2: AnyStr;
  22.    I : INTEGER;
  23.  
  24. (*----------------------------------------------------------------------*)
  25. (*                Fix_Name --- Fix up parameter file name               *)
  26. (*----------------------------------------------------------------------*)
  27.  
  28. FUNCTION Fix_Name( FName : AnyStr; FType : AnyStr ) : AnyStr;
  29.  
  30. BEGIN (* Fix_Name *)
  31.  
  32.    IF ( POS( '.' , FName ) = 0 ) THEN
  33.       FName := FName + '.' + FType;
  34.  
  35.    Fix_Name := UpperCase( FName );
  36.  
  37. END   (* Fix_Parameter_File_Name *);
  38.  
  39. (*----------------------------------------------------------------------*)
  40.  
  41. BEGIN (* Get_Command_Line_Parameters *)
  42.  
  43.                                    (* Set defaults *)
  44.  
  45.    Command_Script_File_Name   := 'PIBTERM.SCR';
  46.    Command_Config_File_Name   := 'PIBTERM.CNF';
  47.    Command_Dialing_File_Name  := 'PIBTERM.FON';
  48.    Command_Prefix_File_Name   := 'PIBTERM.PRE';
  49.    Command_Translate_File_Name:= 'PIBTERM.TRA';
  50.    Command_Function_Key_Name  := 'PIBTERM.FNC';
  51.    Command_Log_File_Name      := 'PIBTERM.LOG';
  52.    Command_Debug_Mode         := FALSE;
  53.    Use_EMM_For_Overlays       := FALSE;
  54.  
  55.                                    (* Loop over command line params *)
  56.    FOR I := 1 TO ParamCount DO
  57.       BEGIN
  58.          S := ParamStr( I );
  59.          IF ( S[1] = '/' ) THEN
  60.             BEGIN
  61.                IF ( S[3] = '=' ) THEN
  62.                   S2    := SubStr( S, 4, LENGTH( S ) - 3 )
  63.                ELSE
  64.                   S2[0] := #0;
  65.                CASE UpCase( S[2] ) OF
  66.                   'S':  Command_Script_File_Name    := Fix_Name( S2 , 'SCR' );
  67.                   'C':  Command_Config_File_Name    := Fix_Name( S2 , 'CNF' );
  68.                   'D':  Command_Dialing_File_Name   := Fix_Name( S2 , 'FON' );
  69.                   'K':  Command_Function_Key_Name   := Fix_Name( S2 , 'FNC' );
  70.                   'L':  Command_Log_File_Name       := Fix_Name( S2 , 'LOG' );
  71.                   'P':  Command_Prefix_File_Name    := Fix_Name( S2 , 'PRE' );
  72.                   'T':  Command_Translate_File_Name := Fix_Name( S2 , 'TRA' );
  73.                   '0':  Command_Debug_Mode          := TRUE;
  74.                   'X':  Use_EMM_For_Overlays        := TRUE;
  75.                   ELSE;
  76.                END (* CASE *);
  77.             END
  78.          ELSE
  79.             Command_Script_File_Name    := Fix_Name( S , 'SCR' );
  80.       END;
  81.  
  82. END   (* Get_Command_Line_Parameters *);
  83.